<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body>
	<fieldset style="border:solid 1px #aaa;padding:3px;">
		<legend >订单基本信息</legend>
		<form id="form1" method="post">
	        <table cellspacing="10" cellpadding="0">
	        	<tr>
	        		<td style="width:130px;" align="right">
	        			收货人：
	        		</td>
	        		<td >
						<input name="id" class="mini-hidden" />
	        			<input name="name" style="width: 130px;" enabled="false" class="mini-textbox" />
	        		</td>
	        		<td style="width:90px;" align="right">
	        			联系电话：
	        		</td>
	        		<td>
	        			<input name="phone" style="width: 130px;" enabled="false" class="mini-textbox" />
	        		</td>
	        	</tr>
	        	<tr>
	        		<td align="right">
	        			地址：
	        		</td>
	        		<td colspan="4">
			      		<input style="width: 130px;" name="province" enabled="false" class="mini-textbox"/>
			      		<input class="mini-textbox" name="city" enabled="false" style="width: 130px;"/>
			      		<input class="mini-textbox" name="district" enabled="false" style="width: 130px;"/>
	        		</td>
	        	</tr>
	        	<tr>
	        		<td align="right">
	        			详细地址：
	        		</td>
	        		<td colspan="2">
	        			<input name="address" class="mini-textbox" enabled="false" style="width:265px;" />
	        		</td>
	        		<td style="width:90px;" align="right">
	      				邮编：
	        		</td>
	        		<td>
	      				<input class="mini-textbox" name="postCode" enabled="false" style="width: 130px;"/>
	        		</td>
	        	</tr>
	        	<tr>
	        		<td align="right">
	        			备注：
	        		</td>
	        		<td colspan="4">
	        			<input class="mini-textbox" name="description" enabled="false" style="width: 510px;" />
	        		</td>
	        	</tr>
	        	<tr>
	        		<td align="right">
	        			是否开发票：
	        		</td>
	        		<td colspan="2">
	        			<input name="invoice" style="width: 130px;" enabled="false" class="mini-textbox" />
	        		</td>
	        		<td align="right">
	        			媒体：
	        		</td>
	        		<td>
	        			<input name="mediaName" style="width: 130px;" enabled="false" class="mini-textbox" />
	        		</td>
	        	</tr>
	        	<tr>
	        		<td align="right">
	        			订单性质：
	        		</td>
	        		<td colspan="2">
	        			<input name="orderNature" style="width: 130px;" enabled="false" class="mini-textbox" />
	        		</td>
	        		<td align="right">
	        			物流公司：
	        		</td>
	        		<td>
	        			<input name="logistics" style="width: 130px;" enabled="false" class="mini-textbox" />
	        		</td>
	        	</tr>
	        	<tr>
	        		<td align="right">
	        			支付方式：
	        		</td>
	        		<td colspan="2">
	        			<input name="payType" style="width: 130px;" enabled="false" class="mini-textbox" />
	        		</td>
	        	</tr>
	        	<tr>
	        		<td align="right">
	        			货款：
	        		</td>
	        		<td colspan="4">
	        			<input class="mini-textbox" name="payment" enabled="false" style="width: 60px;" emptyText=""/>
	        			<span style="margin-left: 84px;">运费：</span>
	        			<input class="mini-textbox" name="freight" enabled="false" style="width: 60px;" />
	        		</td>
	        	</tr>
	        	<tr>
	        		<td align="right" >
	        			应收金额：
	        		</td>
	        		<td colspan="4">
	        			<input class="mini-textbox" name="receivable" enabled="false" style="width: 60px;" />
	        			<span style="margin-left: 60px;">实收金额：</span>
	        			<input class="mini-textbox" name="amountPaid" enabled="false" style="width: 60px;" />
	        			<span style="margin-left: 45px;">本单后余额：</span>
	        			<input class="mini-textbox" name="balance" enabled="false" style="width: 60px;margin-left: 5px;" />
	        		</td>
	        	</tr>
	        	<tr>
	        		<td align="right" >
	        			本单使用积分：
	        		</td>
	        		<td colspan="4">
	        			<input class="mini-textbox" name="usePoints" enabled="false" style="width: 60px;" />
	        			<span style="margin-left: 60px;">本单积分：</span>
	        			<input class="mini-textbox" name="points" enabled="false" style="width: 60px;" />
	        			<span style="margin-left: 45px;">本单后积分：</span>
	        			<input class="mini-textbox" name="afterUsePoints" enabled="false" style="width: 60px;margin-left: 5px;" />
	        		</td>
	        	</tr>
	        	<tr>
	        		<td align="right" >
	        			本单使用红包：
	        		</td>
	        		<td colspan="4">
	        			<input class="mini-textbox" name="useRed" enabled="false" style="width: 60px;" />
	        			<span style="margin-left: 60px;">本单红包：</span>
	        			<input class="mini-textbox" name="red" enabled="false" style="width: 60px;" />
	        			<span style="margin-left: 45px;">本单后红包：</span>
	        			<input class="mini-textbox" name="afterUseRed" enabled="false" style="width: 60px;margin-left: 5px;" />
	        		</td>
	        	</tr>
	        </table>
	    </form>
	</fieldset>
	<div style="text-align:center;padding:10px;">               
        <a class="mini-button" onclick="onOk" style="width:120px;margin-right:40px;">查看订单日志记录</a>       
    </div>
	<fieldset style="border:solid 1px #aaa;padding:3px;">
		<legend >订单产品信息</legend>
		<div id="datagrid1" class="mini-datagrid" style="width:800px;height:auto;" showPager="false" allowResize="false" url="order_detail_view.do" idField="id">
	        <div property="columns">
	            <div field="medicineName" width="5%" headerAlign="center" allowSort="true">名称</div>                
	            <div field="quantity" width="5%" allowSort="true" renderer="onGenderRenderer" align="center" headerAlign="center">数量</div>            
	            <div field="prePrice" width="5%" allowSort="true">价格</div>
	            <div field="freight" width="5%" allowSort="true" dateFormat="yyyy-MM-dd">运费</div>
	            <div field="usePoints" width="5%" headerAlign="center" dateFormat="yyyy-MM-dd" allowSort="true">积分抵扣</div>                
	            <div field="useRed" width="5%" headerAlign="center" dateFormat="yyyy-MM-dd" allowSort="true">红包抵扣</div>                
	            <div field="totalPrice" width="5%" headerAlign="center" dateFormat="yyyy-MM-dd" allowSort="true">实际价格</div>                
	            <div field="premiums" width="5%" headerAlign="center" dateFormat="yyyy-MM-dd" allowSort="true">赠品</div>                
	            <div field="ridePin" width="5%" headerAlign="center" dateFormat="yyyy-MM-dd" allowSort="true">搭销</div>                
	        </div>
    	</div>    
        <input class="mini-hidden" name="ordersId" id="orders_id"/>
        <input class="mini-hidden" name="serialNum" id="orders_no"/>
	</fieldset>
	<div style="text-align:center;padding:10px;">               
        <a class="mini-button" onclick="onCancel" style="width:120px;margin-right:40px;">关闭</a>       
    </div>   
</body>
</html>

<script type="text/javascript">
	mini.parse();
	var form1 = new mini.Form("form1");
	
	/*--------订单产品--------------------------------*/
	var grid = mini.get("datagrid1");
	
	function SetData(data) {
		data = mini.clone(data);
		var orderId = data.id;
		$.post("order_basic_view.do", {id: orderId}, function(info){
			form1.setData(info.data);
			mini.get("orders_no").setValue(info.data.serialNum);
			grid.load({id: orderId });
		}, "json");
	}
	
	function onOk(e) {
		var serialNum = mini.get("orders_no").getValue();
		mini.open({
	   		url: "init_orders_logs_info.do",
	   		allowResize:false,width: 800, height: 400,
           	onload: function () {
               var iframe = this.getIFrameEl();
               var data = {serialNum: serialNum};
               iframe.contentWindow.SetData(data);
       		}
     	});
	}
	
    function onCancel(e) {
    	window.CloseOwnerWindow("cancel");
    }
	

</script>